package com.itheima.day02.Test02;

import java.util.concurrent.atomic.AtomicInteger;

public class Girl implements Runnable {
//    private volatile static int count=0;
//    private static Object lock=new Object();
    AtomicInteger ac=new AtomicInteger(0);
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            //synchronized (lock) {
//                count++;
            int count = ac.incrementAndGet();
            System.out.println("已经送了"+count+"个冰激凌");
           // }
        }
    }
}
